# Makefile for sample java files
#
# If not installed in ORACLE_HOME, set ORACLE_HOME to installation root
#
# ======================================================================

.SUFFIXES : .java .class

CLASSES = XSLSample.class XSLSample2.class

# Change it to the appropriate separator based on the OS.
PATHSEP = :

XMLFILES = match math number position string variable reverse
XML = .xml
XSL = .xsl

# Assumes that the CLASSPATH contains JDK classes.
MAKE_CLASSPATH = .$(PATHSEP)../common$(PATHSEP)$(ORACLE_HOME)/lib/xmlparserv2.jar$(PATHSEP)$(ORACLE_HOME)/jlib/orai18n.jar$(PATHSEP)$(CLASSPATH)

.java.class:
	javac -classpath "$(MAKE_CLASSPATH)" $<

# make all class files
all: $(CLASSES) 

demo: 	$(CLASSES) \
	XSLSample XSLSample2

XSLSample XSLSample2:
	for file in $(XMLFILES) ; \
	do \
	java -classpath "$(MAKE_CLASSPATH)" $< $@ $$file$(XSL) $$file$(XML) > $@_$$file.out; \
	done


clean:
	rm -f *.class
	rm -f *.out
